﻿namespace Com.ZX
{
    #region UI枚举
    /// <summary>
    /// 状态枚举
    /// </summary>
    public enum EnumObjState
	{
		/// <summary>
		/// 未设定
		/// </summary>
		None,
		
		/// <summary>
		/// 正在初始化
		/// </summary>
		Initializing,
		
		/// <summary>
		/// 正在加载
		/// </summary>
		Loading,
		
		/// <summary>
		/// 就绪
		/// </summary>
		Ready,
		
		/// <summary>
		/// 禁用
		/// </summary>
		Disable,
		
		/// <summary>
		/// 隐藏
		/// </summary>
		Hided,
		
		/// <summary>
		/// 关闭
		/// </summary>
		Closed,
	}
	
	/// <summary>
	/// UI类型枚举
	/// </summary>
	public enum EnumUIType
	{
		TestOne,
		//TestTwo,
        MAX_COUNT,
	}
	
	/// <summary>
	/// UI模式枚举 
	/// </summary>
	public enum EnumUIMode
	{
		Normal,    // 可推出界面(UIMainMenu,UIRank等)
		Fixed,     // 固定窗口(UITopBar等)
		PopUp,     // 模式窗口
	}

	/// <summary>
	/// UI显示模式
	/// </summary>
	public enum EnumUIShowMode
	{
		DoNothing,
		HideOther,     // 闭其他界面
		NeedBack,      // 点击返回按钮关闭当前,不关闭其他界面(需要调整好层级关系)
		NoNeedBack,    // 关闭TopBar,关闭其他界面,不加入backSequence队列
	}

	/// <summary>
	/// 
	/// </summary>
	public enum EnumUIColliderMode
	{
		None,      // 显示该界面不包含碰撞背景
		Normal,    // 碰撞透明背景
		WithBg,    // 碰撞非透明背景
	}

    public enum AssetType { Defalut, Bundle }

    public enum UIType { FariyUI, UGUIOrNGUI }

    #endregion

    #region MessageType 枚举
    public enum MessageType
	{
		One,Two,
	}
	#endregion

	#region Prefab定义
	
	/// <summary>
	/// Prefab定义类
	/// </summary>
	public class UIDefine
	{
		/// <summary>
		/// prefabs 根目录
		/// </summary>
		public const string PREFABS = "Prefabs/";
		/// <summary>
		/// 控件prefabs
		/// </summary>
		public const string UI_CONTROLS_PREFABS = "UIPrefabs/Control";
		/// <summary>
		/// 子页面prefabs
		/// </summary>
		public const string UI_SUBUI_PREFABS = "UIPrefabs/SubUI";
		/// <summary>
		/// 图标路径
		/// </summary>
		public const string UI_ICONS_PATH = "UIPrefabs/Icon";
        /// <summary>
        /// FUI package 根目录
        /// </summary>
        public const string FUI_PACKAGE_ROOT = "UI/";

		/// <summary>
		/// 获取指定UIType的prefab路径
		/// </summary>
		/// <param name="uiType">UIType</param>
		/// <returns>路径</returns>
		public static string GetUIPathByType(EnumUIType uiType)
		{
			string path = null;
#if USE_FAIRYGUI
            switch (uiType)
            {
                //case EnumUIType.None:
                //    path = "";
                //    break;
                case EnumUIType.TestOne:
                    path = FUI_PACKAGE_ROOT + "TestOne";
                    break;
                //case EnumUIType.TestTwo:
                //    path = FUI_PACKAGE_ROOT + "TestTwo";
                //    break;
                default:
                    break;
            }
#else
            switch (uiType)
			{
				case EnumUIType.None:
					path = "";
					break;
				case EnumUIType.TestOne:
					path = PREFABS + "TestOne";
					break;
				case EnumUIType.TestTwo:
					path = PREFABS + "TestTwo";
					break;
				default:
					break;
			}
#endif
            return path;
		}
	}

#endregion

    public class AppConst
    {
        public const string _AppName = "";
        public const AssetType _AssetType = AssetType.Defalut;
        public const bool _isDebugMode = true;
    }

#region 委托定义

	/// <summary>
	/// UI状态事件
	/// </summary>
	/// <param name="ui"></param>
	/// <param name="newState"></param>
	/// <param name="oldState"></param>
	public delegate void StateChangeEvent(object ui, EnumObjState newState, EnumObjState oldState);
	/// <summary>
	/// 消息事件
	/// </summary>
	/// <param name="msg"></param>
	public delegate void MessageEvent(Message msg);
#endregion
	public class Define
	{
       
	}
}
